<template>
	<view class="">
		<view class="order_top">
			<view class="time">
				剩余 <span>05:26</span> 请尽快支付
			</view>

			<view class="price">
				<span>￥</span>15.9
			</view>
			<view class="juan">
				<view class="">
					消费券
				</view>
				<view class="flex_b">
					<view class="b1">
						未使用
					</view>
					<!-- 	<view class="b2">
					-￥10
				</view> -->
				</view>
			</view>

			<view class="juan">
				<view class="">
					合计
				</view>
				<view class="DINB">
					<span class="ic">￥</span>15.9
				</view>
			</view>
		</view>
		<view class="zhifu">
			<view class="tit">支付方式</view>
			<view class="items">
				<view class="items_l">
					<image src="/static/icon/wx.png" mode=""></image>
					<view class="ts">
						微信支付
					</view>
				</view>
				<view class="items_r">
					<image src="/static/yuan.png" mode=""></image>
					<!-- <image src="/static/yuana.png" mode=""></image> -->
				</view>
			</view>

			<view class="items">
				<view class="items_l">
					<image src="/static/icon/yh.png" mode=""></image>
					<view class="ts" @click="changeLp">
						礼品卡支付
						<uni-icons v-if="isopen" type="top" size="16"></uni-icons>
						<uni-icons v-else type="down" size="16"></uni-icons>
					</view>
				</view>
				<view class="items_r">
					<image src="/static/yuan.png" mode=""></image>
					<!-- <image src="/static/yuana.png" mode=""></image> -->
					<!-- <image src="/static/yuanx.png" mode=""></image> -->
				</view>
			</view>
			<view class="lplist" v-if="isopen">
				<view class="item" v-for="item in list">
					<view class="item_l">
						<view class="yuan" :style="{background:item.color}">
							<image src="../static/icon/lp.png" mode=""></image>
						</view>
						<view class="t">
							Hnnjmm 礼品卡(4102)
						</view>
						<view class="p">
							￥125.2
						</view>
						<view class="g">
							已过期
						</view>
					</view>
					<view class="item_r">
						<image src="/static/yuan.png" mode=""></image>
						<!-- <image src="/static/yuana.png" mode=""></image> -->
					</view>
				</view>
			</view>
		</view>
		<view class="footerbtn">
			<view class="cont">
				<view class="btn" @click="go">
					确认支付
				</view>
			</view>
		</view>
		<clearts ref="popupts"></clearts>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				colorList: [
					'#C30000',
					'#EB5A00',
					'#29A85C',
					'#FFAF43',
					'#000000',
				],
				list: [{
						color: ''
					},
					{
						color: ''
					},
					{
						color: ''
					},
				],
				isopen: false
			};
		},
		onLoad() {
			this.list.forEach(item => {
				item.color = this.colorList[Math.floor(Math.random() * 5)]
			})
		},
		methods: {
			go() {
				uni.navigateTo({
					url: '/mainpage/paymentresults'
				})
			},
			changeLp() {
				this.isopen = !this.isopen
			},
			goyes() {
				uni.navigateTo({
					url: '/mainpage/paymentresults'
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		background: #FBFBFB;
	}

	.order_top {
		width: 100%;
		padding: 20rpx 20rpx 20rpx;
		box-sizing: border-box;
		background: #fff;

		.time {
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 32rpx;
			color: #CE7034;
			line-height: 38rpx;
			text-align: center;
			margin: 36rpx;

			span {
				font-size: 40rpx;
				margin: 0 10rpx;
			}
		}

		.price {
			font-family: 'DINB';
			font-size: 72rpx;
			color: #000000;
			text-align: center;

			span {
				font-size: 40rpx;
			}
		}

		.juan {
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 28rpx;
			color: #000000;
			margin-top: 32rpx;

			.flex_b {
				.b1 {
					font-weight: 500;
					font-size: 28rpx;
					color: #D1CDCD;
				}

				.b2 {
					font-family: 'DINB';
					font-size: 28rpx;
					color: #FFFFFF;
					height: 32rpx;
					background: #29A85C;
					line-height: 32rpx;
					text-align: center;
					padding: 0rpx 6rpx;
				}
			}
		}

	}

	.zhifu {
		width: 750rpx;
		background: #FFFFFF;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		padding: 22rpx 20rpx;
		box-sizing: border-box;
		margin-top: 20rpx;

		.tit {
			font-family: PingFang SC, PingFang SC;
			font-weight: bold;
			font-size: 32rpx;
			color: #000000;
		}

		.items {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin: 40rpx auto 0rpx;

			.items_l {
				display: flex;
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				font-size: 28rpx;
				color: #000000;

				image {
					width: 40rpx;
					height: 40rpx;
				}

				.ts {
					margin-left: 20rpx;
				}

			}

			.items_r {
				image {
					width: 40rpx;
					height: 40rpx;
				}
			}
		}

		.lplist {
			width: 100%;
			padding: 0rpx 0rpx 0rpx 60rpx;
			box-sizing: border-box;

			.item {
				display: flex;
				align-items: center;
				justify-content: space-between;
				border-bottom: 1px solid #eee;
				padding-bottom: 26rpx;
				margin-top: 20rpx;

				.item_l {
					display: flex;
					align-items: center;

					.yuan {
						width: 40rpx;
						height: 40rpx;
						border-radius: 20rpx;

						image {
							width: 40rpx;
							height: 40rpx;
						}
					}

					.t {
						font-family: PingFang SC, PingFang SC;
						font-weight: 500;
						font-size: 28rpx;
						color: #000000;
						margin-left: 20rpx;
					}

					.p {
						font-family: 'DINB';
						font-weight: 500;
						font-size: 20rpx;
						color: #FFFFFF;
						height: 32rpx;
						background: #29A85C;
						padding: 0rpx 10rpx;
						line-height: 32rpx;
						margin-left: 20rpx;
					}

					.g {
						color: #CACACA;
						font-weight: 500;
						font-size: 20rpx;
						height: 32rpx;
						background: #EEEEEE;
						border-radius: 0rpx 0rpx 0rpx 0rpx;
						padding: 0rpx 10rpx;
						line-height: 32rpx;
						margin-left: 20rpx;
					}
				}

				.item_r {
					image {
						width: 40rpx;
						height: 40rpx;
					}
				}
			}

			.item:last-child {
				padding-bottom: 0rpx;
				border-bottom: none;
			}
		}
	}

	.footerbtn {
		width: 750rpx;
		height: 120rpx;
		background: #FFFFFF;
		position: fixed;
		bottom: 0%;
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);

		.cont {
			display: flex;
			padding: 10rpx 20rpx;
			height: 120rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 32rpx;
			align-items: center;
			justify-content: center;

			.btn {
				width: 670rpx;
				height: 100rpx;
				background: #000000;
				border-radius: 8rpx 8rpx 8rpx 8rpx;
				color: #FFFFFF;
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				font-size: 32rpx;
				color: #FFFFFF;
				line-height: 100rpx;
				text-align: center;
			}

			.absbtn {
				background: #808080;
			}
		}
	}
</style>